package com.temp_3;

import java.util.Arrays;

/**
 * int于string相互转换
 * **/
public class IntToString {
    public static void main(String[] args) {
        int number = 20;
        String s = String.valueOf(number);


        String string = "20";
        int in = Integer.parseInt(string);

        String str = "20 10 21 2 19 44 3";

        String[] strings = str.split(" ");
        int[] ints = new int[strings.length];

        for(int i=0;i<strings.length;i++){
            ints[i] = Integer.parseInt(strings[i]);
        }
        Arrays.sort(ints);

        StringBuilder sb = new StringBuilder();

        for(int j=0;j<ints.length;j++){
            if(j==ints.length-1){
                sb.append(ints[j]);
            }else{
                sb.append(ints[j]).append(" ");
            }
        }
        System.out.println(sb.toString());
    }
}
